3.3.92 \(\int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx\) [292]

Optimal. Leaf size=174 \[ \frac {\sec ^n(e+f x) \sin (e+f x)}{f (a+a \sec (e+f x))}+\frac {(1-n) \, _2F_1\left (\frac {1}{2},\frac {2-n}{2};\frac {4-n}{2};\cos ^2(e+f x)\right ) \sec ^{-2+n}(e+f x) \sin (e+f x)}{a f (2-n) \sqrt {\sin ^2(e+f x)}}-\frac {\, _2F_1\left (\frac {1}{2},\frac {1-n}{2};\frac {3-n}{2};\cos ^2(e+f x)\right ) \sec ^{-1+n}(e+f x) \sin (e+f x)}{a f \sqrt {\sin ^2(e+f x)}} \]

[Out]

sec(f*x+e)^n*sin(f*x+e)/f/(a+a*sec(f*x+e))+(1-n)*hypergeom([1/2, 1-1/2*n],[2-1/2*n],cos(f*x+e)^2)*sec(f*x+e)^(
-2+n)*sin(f*x+e)/a/f/(2-n)/(sin(f*x+e)^2)^(1/2)-hypergeom([1/2, 1/2-1/2*n],[3/2-1/2*n],cos(f*x+e)^2)*sec(f*x+e
)^(-1+n)*sin(f*x+e)/a/f/(sin(f*x+e)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 174, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3905, 3872, 3857, 2722} \begin {gather*} \frac {(1-n) \sin (e+f x) \sec ^{n-2}(e+f x) \, _2F_1\left (\frac {1}{2},\frac {2-n}{2};\frac {4-n}{2};\cos ^2(e+f x)\right )}{a f (2-n) \sqrt {\sin ^2(e+f x)}}-\frac {\sin (e+f x) \sec ^{n-1}(e+f x) \, _2F_1\left (\frac {1}{2},\frac {1-n}{2};\frac {3-n}{2};\cos ^2(e+f x)\right )}{a f \sqrt {\sin ^2(e+f x)}}+\frac {\sin (e+f x) \sec ^n(e+f x)}{f (a \sec (e+f x)+a)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]^n/(a + a*Sec[e + f*x]),x]

[Out]

(Sec[e + f*x]^n*Sin[e + f*x])/(f*(a + a*Sec[e + f*x])) + ((1 - n)*Hypergeometric2F1[1/2, (2 - n)/2, (4 - n)/2,
 Cos[e + f*x]^2]*Sec[e + f*x]^(-2 + n)*Sin[e + f*x])/(a*f*(2 - n)*Sqrt[Sin[e + f*x]^2]) - (Hypergeometric2F1[1
/2, (1 - n)/2, (3 - n)/2, Cos[e + f*x]^2]*Sec[e + f*x]^(-1 + n)*Sin[e + f*x])/(a*f*Sqrt[Sin[e + f*x]^2])

Rule 2722

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*((b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1
)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 3857

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x])^(n - 1)*((Sin[c + d*x]/b)^(n - 1)
*Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3905

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-b)*d*Cot[
e + f*x]*((d*Csc[e + f*x])^(n - 1)/(a*f*(a + b*Csc[e + f*x]))), x] + Dist[d*((n - 1)/(a*b)), Int[(d*Csc[e + f*
x])^(n - 1)*(a - b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f, n}, x] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx &=\frac {\sec ^n(e+f x) \sin (e+f x)}{f (a+a \sec (e+f x))}-\frac {(1-n) \int \sec ^{-1+n}(e+f x) (a-a \sec (e+f x)) \, dx}{a^2}\\ &=\frac {\sec ^n(e+f x) \sin (e+f x)}{f (a+a \sec (e+f x))}-\frac {(1-n) \int \sec ^{-1+n}(e+f x) \, dx}{a}+\frac {(1-n) \int \sec ^n(e+f x) \, dx}{a}\\ &=\frac {\sec ^n(e+f x) \sin (e+f x)}{f (a+a \sec (e+f x))}-\frac {\left ((1-n) \cos ^n(e+f x) \sec ^n(e+f x)\right ) \int \cos ^{1-n}(e+f x) \, dx}{a}+\frac {\left ((1-n) \cos ^n(e+f x) \sec ^n(e+f x)\right ) \int \cos ^{-n}(e+f x) \, dx}{a}\\ &=\frac {\sec ^n(e+f x) \sin (e+f x)}{f (a+a \sec (e+f x))}+\frac {(1-n) \, _2F_1\left (\frac {1}{2},\frac {2-n}{2};\frac {4-n}{2};\cos ^2(e+f x)\right ) \sec ^{-2+n}(e+f x) \sin (e+f x)}{a f (2-n) \sqrt {\sin ^2(e+f x)}}-\frac {\, _2F_1\left (\frac {1}{2},\frac {1-n}{2};\frac {3-n}{2};\cos ^2(e+f x)\right ) \sec ^{-1+n}(e+f x) \sin (e+f x)}{a f \sqrt {\sin ^2(e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]
time = 0.90, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^n(e+f x)}{a+a \sec (e+f x)} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

Integrate[Sec[e + f*x]^n/(a + a*Sec[e + f*x]),x]

[Out]

Integrate[Sec[e + f*x]^n/(a + a*Sec[e + f*x]), x]

________________________________________________________________________________________

Maple [F]
time = 0.06, size = 0, normalized size = 0.00 \[\int \frac {\sec ^{n}\left (f x +e \right )}{a +a \sec \left (f x +e \right )}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)^n/(a+a*sec(f*x+e)),x)

[Out]

int(sec(f*x+e)^n/(a+a*sec(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^n/(a+a*sec(f*x+e)),x, algorithm="maxima")

[Out]

integrate(sec(f*x + e)^n/(a*sec(f*x + e) + a), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^n/(a+a*sec(f*x+e)),x, algorithm="fricas")

[Out]

integral(sec(f*x + e)^n/(a*sec(f*x + e) + a), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\sec ^{n}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)**n/(a+a*sec(f*x+e)),x)

[Out]

Integral(sec(e + f*x)**n/(sec(e + f*x) + 1), x)/a

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)^n/(a+a*sec(f*x+e)),x, algorithm="giac")

[Out]

integrate(sec(f*x + e)^n/(a*sec(f*x + e) + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (\frac {1}{\cos \left (e+f\,x\right )}\right )}^n}{a+\frac {a}{\cos \left (e+f\,x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1/cos(e + f*x))^n/(a + a/cos(e + f*x)),x)

[Out]

int((1/cos(e + f*x))^n/(a + a/cos(e + f*x)), x)

________________________________________________________________________________________